/*
 * @Author: Shane
 * @Date: 2022-07-01 16:30:35
 * @LastEditTime: 2022-07-01 16:31:41
 * @LastEditors: Shane
 * @Description: 
 * @FilePath: /app-framework/common_widgets/lib/app_bar/app_bar_search.dart
 */

import 'package:common_widgets/app_bar/app_bar_base.dart';
import 'package:common_widgets/search/serach_bar.dart';
import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';

class KKAppSearchBar extends KKAppBarBase {
  KKAppSearchBar(
    BuildContext context, {
    Key? key,
    TextEditingController? editingController,
    String? hintText,
    Color? backgroundColor,
    double? elevation,
    Brightness? brightness,
    Widget? leading,
    Widget? icon,
    Widget? search,
    PreferredSizeWidget? bottom,
    double leadingWidth = 56,
    double titleSpacing = 0,
    double rightPadding = 20,
    bool enabled = true,
    Function()? onTapCallback,
    Function(String)? onSearchClick,
  }) : super(
          context,
          key: key,
          title: Padding(
            padding: EdgeInsets.only(
              right: rightPadding,
            ),
            child: KKSearchBar(
              icon: icon,
              editingController: editingController,
              height: 32,
              enabled: enabled,
              search: search,
              hintText: hintText,
              onSearchClick: onSearchClick,
            ),
          ),
          centerTitle: true,
          backgroundColor: backgroundColor ?? Colors.white,
          elevation: elevation ?? 0,
          leadingWidth: leadingWidth,
          leading: leading,
          titleSpacing: titleSpacing,
          bottom: bottom,
          onTapCallback: onTapCallback,
        );
}
